#ifndef UUID_644FCF12367F4D475780169F9A4EAE7C
#define UUID_644FCF12367F4D475780169F9A4EAE7C

#include <stdlib.h>
#include "platform.h"
#include "cstdint.h"

#if TL_MSVCPP

unsigned short _byteswap_ushort (
   unsigned short val
);
unsigned long _byteswap_ulong (
   unsigned long val
);
unsigned __int64 _byteswap_uint64 (
   unsigned __int64 val
);

#define tl_byteswap16(x) _byteswap_ushort(x)
#define tl_byteswap32(x) _byteswap_ulong(x)

#else

TL_INLINE uint16_t tl_byteswap16(uint16_t x) { return (x << 8) | (x >> 8); }
TL_INLINE uint32_t tl_byteswap32(uint32_t x) { return (x << 24) | (x >> 24) | ((x >> 8) & 0xff00) | ((x & 0xff00) << 8); }

#endif

#endif // UUID_644FCF12367F4D475780169F9A4EAE7C
